package com.example.server;

import com.example.service.MyService;
import com.example.service.impl.MyServiceImpl;

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;

/**
 * @Description
 * @Author 26233
 * @Create 2021-10-31 17:29:54
 */

public class Main {

    public static void main(String[] args) {

        try {
            MyService myService = new MyServiceImpl();
            LocateRegistry.createRegistry(9999);
            Naming.rebind("rmi://localhost:9999/myservice", myService);
            System.out.println("server start...");
        } catch (RemoteException e) {
            e.printStackTrace();
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }

    }
}
